#pragma once

#ifndef _ABSTRACT_PIN_H_
#define _ABSTRACT_PIN_H_

#include "board.h"

namespace arduino {

class abstract_pin
{
//private:
	//abstract_pin(const abstract_pin&);
	//abstract_pin& operator=(const abstract_pin& other);
	friend class board;

	//! Initializes pin, on true board brd_ is set with valid board pointer by its setup() method.
	virtual bool initialize() = 0;

protected:
	board* brd_;
	const unsigned int pin_number_;
	unsigned int state_;

public:
	abstract_pin(unsigned int pin_number) : pin_number_(pin_number), state_(0), brd_(0)
	{}
	virtual ~abstract_pin() {}
	unsigned int pin_number() const;
	unsigned int state() const;
	void set_state(unsigned int state);
};

} // namespace arduino

#endif
